<?php

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
#	FILE:			includes/flash/getimagelist.php
#	FUNCTION:		Gets the full list of uploaded images
#	AUTHOR:			Cameron Morrow
#	CREATED:		12/08/2005
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Report all errors
error_reporting(E_ALL);

# Start session
session_start();

# Use this for IE to remember form data correctly
header("Cache-control: private");

# Output as XML
header("content-type: text/xml");

# Vars
$ERROR_ARRAY = array();

# Includes
include "../../site_specific/project.php";
include "../../includes/constants.php";
include "../../includes/utilities.php";
include "../../includes/pages.php";
include "../../includes/users.php";
include "../../includes/files.php";

# Get file list
$file_list = getFiles("../../assets/uploads/");

# Image List
$image_list = array();

# Get JPG images
foreach ($file_list as $index => $file_name) {

	# If has a JPG file type
	if (substr(strtolower($file_name), strlen($file_name) - 4) == ".jpg") {
		$image_list[] = $file_name;
	}
}

# Output Header
echo "<?phpxml version=\"1.0\" encoding=\"iso-8859-1\"?>";
echo "<images>";

# Output images
foreach ($image_list as $file_name) {
	echo "<image name=\"" . $file_name . "\" />";
}

# Close
echo "</images>";

?>